package com.kl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kl.entity.TbContacts;
import com.kl.entity.TbTaxpayer;
import com.kl.mapper.TbTaxpayerMapper;
import com.kl.service.ITbTaxpayerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2021-10-29
 */
@Service
public class TbTaxpayerServiceImpl extends ServiceImpl<TbTaxpayerMapper, TbTaxpayer> implements ITbTaxpayerService {

    @Autowired
    private TbTaxpayerMapper tbTaxpayerMapper;

    @Override
    public List<TbTaxpayer> selectByUserName(String userName) {
        QueryWrapper<TbTaxpayer> queryWrapper = new QueryWrapper<>();
        queryWrapper.like(StringUtils.isNotBlank(userName), "tb_username", userName);
        List<TbTaxpayer> tbTaxpayers = tbTaxpayerMapper.selectList(queryWrapper);
        return tbTaxpayers;
    }
}
